package com.agp.web;

import com.agp.api.test.IHelloApi;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * demo示例
 *
 * @author oKong
 */
@RestController
@Api(tags = "servicie-one服务")
@Slf4j
public class DemoController {

    @Autowired
    IHelloApi helloApi;

    @GetMapping("/hello")
    @ApiOperation(value = "demo示例")
    public DemoResp hello(DemoReq demoReq) {
        log.info("DemoReq:{}", demoReq);

        String index = helloApi.index("1231231");

        return DemoResp.builder()
                .code(demoReq.getCode())
                .name(demoReq.getName())
                .remark(index)
                .build();
    }
}